4D Chart v13

CT ON ERROR

Home

 
4D Chart v13
CT ON ERROR

CT ON ERROR 


 

CT ON ERROR ( method ) 
Parameter Type   Description
method  String in Method to execute

The CT ON ERROR command installs method as the method for managing 4D Chart errors. After the installation of the error handling method, 4D Chart calls method when a 4D Chart error occurs.

If method is an empty string, no method is called and error handling returns to 4D Chart.

When 4D Chart calls method, it returns three parameters ($1, $2, and $3) that can be used to manage the error.

ParameterTypeDescription
$1LongintRepresents the 4D Chart area in which the error took place. If the error is not specific to a 4D Chart area, $1 equals 0.
$2LongintHolds the error number. Equivalent of a call to CT Error.
$3TextContains the text of the error. Equivalent of a call to CT Error.

If you plan to compile your database, you should declare these paramer types as follows:

 C_LONGINT($1;$2)
 C_TEXT($3)

Example  

This example shows the installation of an error-handling method.

 CT ON ERROR("CHART ERROR")

The following method is CHART ERROR. This method tests $1 to determine whether an error occurred in area and then presents an alert box with the error number and message.

 C_LONGINT($1;$2)
 C_TEXT($3)
 
 If($1=Area)
    ALERT("An error occurred in the 4D Chart area 'Area'.")
 End if
 ALERT("Error number "+String($2)+Char(13)+$3)

 
PROPERTIES 

Product: 4D Chart
Theme: CT Area Control
Number: 14513

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created:
Created: 4D Chart 1

 
SEE ALSO 

4D Chart Error Codes
CT Error